<?php
$config = include_once('../../public/config/config.php');
include_once('../../public/func/db.php');
include_once('../../public/func/upload.func.php');
$post = $_POST;
if($_FILES['pic']['error'] != 4){
	$path = '../../public/upload';
	$post['pic'] = upload($_FILES['pic'],$path);
}
$res = update($config,'user',$post);
if($res == ''){
	echo '<script>alert("修改成功");window.location.href="./index.php"</script>';
}else{
	echo '<script>alert("修改失败");window.location.href="./index.php"</script>';
}